<template>
  <el-breadcrumb :separator-icon="ArrowRight">
    <el-breadcrumb-item :to="{ path: '/index/indexabout' }">{{$t(this.$route.matched[0].meta.title)}}</el-breadcrumb-item>
    <el-breadcrumb-item  v-for="(item,index) in routelist" :key="index">{{$t(item.meta.title)}}</el-breadcrumb-item>
  </el-breadcrumb>
</template>
<script>
import { ArrowRight } from "@element-plus/icons-vue";
export default {
  setup() {
    return {
      ArrowRight,
    };
  },
  data() {
    return {
      routelist: [],
    };
  },
  created() {
    this.routelist = this.$route.matched.slice(1);//创建前就替换掉-----slice方法可以截取数组和字符串，不会影响其它的数组，而是将截取到数组封装到一个新的数组并且返回参数
  },
  watch:{
    $route(){
      this.routelist = this.$route.matched.slice(1);//监听路由---替换掉当前路由的信息
      console.log(this.$route,"000现在监听的路由");
    }
  },
  methods: {
   
  },
};
</script>